package graphicView;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**
 * Team EBE
 * 
 * RelationshipGUI.java is the non-functional user interface to edit a
 * relationship
 * 
 */
public class RelationshipGUI extends JPanel implements MouseListener,
		ActionListener {

	private static final long serialVersionUID = 1L;
	private JFrame relframe;
	private GraphicController controller;
	private JTextField inputField;
	private JTextArea theOutputMessage;
	private JScrollPane JSP;
	private Container RPanel;
	private LayoutManager GLayout;
	private JComboBox JCB;

	public RelationshipGUI(GraphicController rController, JFrame rFrame) {
		relframe = rFrame;
		controller = rController;
		// JPanel RelatePanel = setupRelLayout();

		JPanel RelatePanel = setupRelLayout();
		relframe.getContentPane().add(RelatePanel, BorderLayout.CENTER);
		// createMenu(frame);
		// createTextItems(widgetPanel);
		// createButton(widgetPanel);
		// setSizes();
		addMouseListener(this);
	}

	private JPanel setupRelLayout() {

		JButton srcbutton = new JButton("Pick src");
		JButton destbutton = new JButton("Pick dest");
		JButton insbutton = new JButton("Insert");
		JButton canbutton = new JButton("Cancel");
		JButton typebutton = new JButton("Type");
		JTextArea JTAS = new JTextArea(10, 10);
		JTextArea JTAD = new JTextArea(10, 10);
		JComboBox JCB = new JComboBox();

		JPanel RelatePanel = new JPanel();

		GLayout = new GridLayout(4, 2);
		setLayout(new GridLayout(4, 2));

		RelatePanel.add(srcbutton);
		RelatePanel.add(JTAS);
		RelatePanel.add(destbutton);
		RelatePanel.add(JTAD);
		RelatePanel.add(typebutton);
		RelatePanel.add(JCB);
		RelatePanel.add(insbutton);
		RelatePanel.add(canbutton);

		RelatePanel.setPreferredSize(new Dimension(450, 450));
		RelatePanel.setBorder(BorderFactory.createLineBorder(Color.gray, 2));

		return RelatePanel;

	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

}